package com.sg.plmadapter.adapters;

import com.mobnut.db.model.PrimaryObject;
import com.sg.business.model.IPLM_Object;
import com.sg.plmadapter.windchill.PMWebservice;

public class GetDocumentUrl extends WindchillSyncJob {
	

	private String documentStream;
	
	public GetDocumentUrl(PMWebservice windchill, PrimaryObject po) {
		super(windchill, po);
	}

	@Override
	protected void run(PMWebservice windchill, PrimaryObject po)
			throws Exception {
		documentStream = windchill.getRepresentationByPM(po.get_id().toString());
	}

	@Override
	protected String getRequestCode() {
		return IPLM_Object.REQUEST_GET_DOCUMENT_URL;
	}

	public String getDocumentUrl() {
		return documentStream;
	}

	public void setDocumentUrl(String documentStream) {
		this.documentStream = documentStream;
	}

	@Override
	protected boolean canReload(PrimaryObject po) {
		return false;
	}

}
